/*     */ package com.iris.egrant.web.struts2.tags;
/*     */ 
/*     */ import com.iris.egrant.app.utils.IrisStringUtils;
/*     */ import freemarker.template.Configuration;
/*     */ import freemarker.template.Template;
/*     */ import java.io.Writer;
/*     */ import java.util.ArrayList;
/*     */ import java.util.HashMap;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ import javax.servlet.jsp.JspException;
/*     */ import javax.servlet.jsp.tagext.BodyTagSupport;
/*     */ import net.sf.json.JSONSerializer;
/*     */ import org.springframework.context.i18n.LocaleContextHolder;
/*     */ import org.springframework.web.context.WebApplicationContext;
/*     */ import org.springframework.web.context.support.WebApplicationContextUtils;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class TreeTag
/*     */   extends BodyTagSupport
/*     */ {
/*     */   private static final long serialVersionUID = 1077194066541229822L;
/*  32 */   private String key = "";
/*     */   
/*  34 */   private String locale = "";
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   
/*  40 */   private String showPattern = "current";
/*     */ 
/*     */ 
/*     */   
/*  44 */   private String shieldPattern = "-1";
/*     */ 
/*     */   
/*  47 */   private String id = "";
/*     */ 
/*     */   
/*  50 */   private String checkable = "false";
/*     */ 
/*     */   
/*  53 */   private String onlyChooseLeaf = "false";
/*     */ 
/*     */   
/*  56 */   private String cacheable = "true";
/*     */   
/*  58 */   private String topCheckbox = "true";
/*     */ 
/*     */   
/*  61 */   private String sqlParamVal = "";
/*     */   
/*  63 */   private String onClick = "";
/*     */ 
/*     */   
/*  66 */   private String value = "";
/*     */ 
/*     */   
/*  69 */   private List data = new ArrayList();
/*     */ 
/*     */ 
/*     */   
/*  73 */   private String width = "20px;";
/*     */ 
/*     */   
/*  76 */   private String className = "";
/*     */ 
/*     */   
/*  79 */   private String readonly = "false";
/*     */ 
/*     */   
/*  82 */   private String cleanIcon = "true";
/*     */ 
/*     */   
/*  85 */   private String name = "";
/*     */   
/*  87 */   private String label = "";
/*     */   
/*  89 */   private String selectIcon = "false";
/*     */   
/*     */   private boolean keysFind = true;
/*     */ 
/*     */   
/*     */   public boolean isKeysFind() {
/*  95 */     return this.keysFind;
/*     */   }
/*     */   
/*     */   public void setKeysFind(boolean keysFind) {
/*  99 */     this.keysFind = keysFind;
/*     */   }
/*     */ 
/*     */   
/* 103 */   private String title = "";
/*     */   
/*     */   public String getOnClick() {
/* 106 */     return this.onClick;
/*     */   }
/*     */   
/*     */   public void setOnClick(String onClick) {
/* 110 */     this.onClick = onClick;
/*     */   }
/*     */ 
/*     */   
/*     */   public List getData() {
/* 115 */     return this.data;
/*     */   }
/*     */ 
/*     */   
/*     */   public void setData(List data) {
/* 120 */     this.data = data;
/*     */   }
/*     */   
/*     */   public String getCacheable() {
/* 124 */     return this.cacheable;
/*     */   }
/*     */   
/*     */   public void setCacheable(String cacheable) {
/* 128 */     this.cacheable = cacheable;
/*     */   }
/*     */   
/*     */   public String getSqlParamVal() {
/* 132 */     return this.sqlParamVal;
/*     */   }
/*     */   
/*     */   public void setSqlParamVal(String sqlParamVal) {
/* 136 */     this.sqlParamVal = sqlParamVal;
/*     */   }
/*     */   
/*     */   public String getCheckable() {
/* 140 */     return this.checkable;
/*     */   }
/*     */   
/*     */   public void setCheckable(String checkable) {
/* 144 */     this.checkable = checkable;
/*     */   }
/*     */   
/*     */   public String getLocale() {
/* 148 */     if (IrisStringUtils.isNullOrBlank(this.locale)) {
/* 149 */       return LocaleContextHolder.getLocale().toString();
/*     */     }
/* 151 */     return this.locale;
/*     */   }
/*     */   
/*     */   public void setLocale(String locale) {
/* 155 */     this.locale = locale;
/*     */   }
/*     */ 
/*     */   
/*     */   public int doStartTag() throws JspException {
/* 160 */     WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
/*     */ 
/*     */     
/* 163 */     Configuration cptFreemarkereConfiguration = (Configuration)context.getBean("cptFreemarkereConfiguration");
/*     */     
/*     */     try {
/* 166 */       String res = (String)this.pageContext.getAttribute("res");
/* 167 */       String ctx = (String)this.pageContext.getAttribute("ctx");
/*     */ 
/*     */       
/* 170 */       Map<String, Object> params = new HashMap<String, Object>();
/* 171 */       params.put("key", this.key);
/* 172 */       params.put("sqlParamVal", this.sqlParamVal);
/* 173 */       params.put("cacheable", this.cacheable);
/* 174 */       params.put("locale", getLocale());
/*     */       
/* 176 */       Map<String, Object> jsParams = new HashMap<String, Object>();
/*     */       
/* 178 */       jsParams.put("onClick", this.onClick);
/* 179 */       jsParams.put("keysFind", Boolean.valueOf(this.keysFind));
/*     */       
/* 181 */       jsParams.put("checkable", this.checkable);
/* 182 */       jsParams.put("topCheckbox", this.topCheckbox);
/* 183 */       jsParams.put("showPattern", this.showPattern);
/* 184 */       jsParams.put("shieldPattern", this.shieldPattern);
/* 185 */       jsParams.put("onlyChooseLeaf", this.onlyChooseLeaf);
/*     */       
/* 187 */       Map<String, Object> rootMap = new HashMap<String, Object>();
/* 188 */       rootMap.put("res", res);
/* 189 */       rootMap.put("ctx", ctx);
/* 190 */       rootMap.put("id", this.id);
/*     */       
/* 192 */       rootMap.put("id2", this.id.replace("[", "").replace("]", ""));
/* 193 */       rootMap.put("value", this.value);
/* 194 */       rootMap.put("data", this.data);
/* 195 */       rootMap.put("width", this.width);
/* 196 */       rootMap.put("name", (this.name.length() > 0) ? this.name : this.id);
/* 197 */       rootMap.put("label", this.label);
/* 198 */       rootMap.put("title", this.title);
/*     */       
/* 200 */       rootMap.put("params", JSONSerializer.toJSON(params).toString().replaceAll("\"", "\\\""));
/* 201 */       rootMap.put("jsParams", JSONSerializer.toJSON(jsParams).toString());
/* 202 */       rootMap.put("cleanIcon", this.cleanIcon);
/* 203 */       rootMap.put("className", this.className);
/* 204 */       rootMap.put("readonly", this.readonly);
/* 205 */       Template template = cptFreemarkereConfiguration.getTemplate("tree.ftl", "utf-8");
/*     */       
/* 207 */       template.process(rootMap, (Writer)this.pageContext.getOut());
/*     */     }
/* 209 */     catch (Exception e) {
/* 210 */       throw new JspException(e);
/*     */     } 
/*     */     
/* 213 */     return 0;
/*     */   }
/*     */ 
/*     */   
/*     */   public String getId() {
/* 218 */     return this.id;
/*     */   }
/*     */ 
/*     */   
/*     */   public void setId(String id) {
/* 223 */     this.id = id;
/*     */   }
/*     */   
/*     */   public String getValue() {
/* 227 */     return this.value;
/*     */   }
/*     */   
/*     */   public void setValue(String value) {
/* 231 */     this.value = value;
/*     */   }
/*     */   
/*     */   public String getKey() {
/* 235 */     return this.key;
/*     */   }
/*     */   
/*     */   public void setKey(String key) {
/* 239 */     this.key = key;
/*     */   }
/*     */   
/*     */   public String getWidth() {
/* 243 */     return this.width;
/*     */   }
/*     */   
/*     */   public void setWidth(String width) {
/* 247 */     this.width = width;
/*     */   }
/*     */   
/*     */   public String getClassName() {
/* 251 */     return this.className;
/*     */   }
/*     */   
/*     */   public void setClassName(String className) {
/* 255 */     this.className = className;
/*     */   }
/*     */   
/*     */   public String getReadonly() {
/* 259 */     return this.readonly;
/*     */   }
/*     */   
/*     */   public void setReadonly(String readonly1) {
/* 263 */     this.readonly = readonly1;
/*     */   }
/*     */   
/*     */   public String getName() {
/* 267 */     return this.name;
/*     */   }
/*     */   
/*     */   public void setName(String name) {
/* 271 */     this.name = name;
/*     */   }
/*     */   
/*     */   public String getLabel() {
/* 275 */     return this.label;
/*     */   }
/*     */   
/*     */   public void setLabel(String label) {
/* 279 */     this.label = label;
/*     */   }
/*     */   
/*     */   public String getTopCheckbox() {
/* 283 */     return this.topCheckbox;
/*     */   }
/*     */   
/*     */   public void setTopCheckbox(String topCheckbox) {
/* 287 */     this.topCheckbox = topCheckbox;
/*     */   }
/*     */   
/*     */   public String getShowPattern() {
/* 291 */     return this.showPattern;
/*     */   }
/*     */   
/*     */   public void setShowPattern(String showPattern) {
/* 295 */     this.showPattern = showPattern;
/*     */   }
/*     */   
/*     */   public String getShieldPattern() {
/* 299 */     return this.shieldPattern;
/*     */   }
/*     */   
/*     */   public void setShieldPattern(String shieldPattern) {
/* 303 */     this.shieldPattern = shieldPattern;
/*     */   }
/*     */   
/*     */   public String getCleanIcon() {
/* 307 */     return this.cleanIcon;
/*     */   }
/*     */   
/*     */   public void setCleanIcon(String cleanIcon) {
/* 311 */     this.cleanIcon = cleanIcon;
/*     */   }
/*     */   
/*     */   public String getOnlyChooseLeaf() {
/* 315 */     return this.onlyChooseLeaf;
/*     */   }
/*     */   
/*     */   public void setOnlyChooseLeaf(String onlyChooseLeaf) {
/* 319 */     this.onlyChooseLeaf = onlyChooseLeaf;
/*     */   }
/*     */   
/*     */   public String getTitle() {
/* 323 */     return this.title;
/*     */   }
/*     */   
/*     */   public void setTitle(String title) {
/* 327 */     this.title = title;
/*     */   }
/*     */   
/*     */   public String getSelectIcon() {
/* 331 */     return this.selectIcon;
/*     */   }
/*     */   
/*     */   public void setSelectIcon(String selectIcon) {
/* 335 */     this.selectIcon = selectIcon;
/*     */   }
/*     */ }


/* Location:              D:\文件kjt\WEB-INF\lib\egrant-core-2.2.20240205.1659.jar!\com\iris\egrant\web\struts2\tags\TreeTag.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       1.1.3
 */